# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer:
pkgname=urlview
# ghbump to update http://sprunge.us/bQYI
_project="sigpipe/urlview"
_sha=08767aa863cd27d1755ba0aff65b8cc1a0c1446a
pkgver=20131023
pkgrel=1
pkgdesc="urlview is a program for extracting URLs from text files"
options="!check" # No testsuite
url="https://github.com/sigpipe/urlview"
arch="all"
license="GPL-2.0-or-later"
depends="bash"
makedepends="ncurses-dev automake autoconf libtool"
subpackages="$pkgname-doc"
source="$pkgname-$_sha.tar.gz::https://github.com/sigpipe/urlview/archive/$_sha.tar.gz"
builddir="$srcdir/$pkgname-$_sha"

prepare() {
	default_prepare
	autoreconf -fi
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var
	make
}

package() {
	mkdir -p "$pkgdir"/etc/urlview \
		"$pkgdir"/usr/share/man/man1 \
		"$pkgdir"/usr/bin
	make prefix="$pkgdir"/usr \
		mandir="$pkgdir"/usr/share/man install
	install -Dm755 url_handler.sh \
		"$pkgdir"/etc/urlview/url_handler.sh
	install -Dm644 sample.urlview \
		"$pkgdir"/etc/urlview/system.urlview
	ln -fs /etc/urlview/url_handler.sh \
		"$pkgdir"/usr/bin/url_handler.sh
}

sha512sums="0fe27ec22e591a25b57150abe1e7181d8472e17e0305beda7fbf355dc6f80799193f7859ce5f18155adb3ee7f01657bbb8d4c307770b8a3d2fc4bc5b937646d6  urlview-08767aa863cd27d1755ba0aff65b8cc1a0c1446a.tar.gz"
